package com.itljm.cxrMarket.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itljm.cxrMarket.mapper.SysRoleMapper;
import com.itljm.cxrMarket.entity.SysRole;
import com.itljm.cxrMarket.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysRoleServiceImpl implements SysRoleService {

    @Autowired
    private SysRoleMapper sysRoleMapper;

    @Override
    public List<SysRole> selectRolePage(Page<SysRole> page, Wrapper<SysRole> entityWrapper) {
        return sysRoleMapper.selectRolePage(page,entityWrapper);
    }

    @Override
    public List<SysRole> selectAllRole() {
        return sysRoleMapper.selectAllRole();
    }

    @Override
    public boolean insertRole(SysRole sysRole) {
        return sysRoleMapper.insert(sysRole)>0;
    }

    @Override
    public boolean deleteRole(Integer id) {
        return sysRoleMapper.deleteById(id)>0;
    }

    @Override
    public boolean updateRole(SysRole sysRole) {
        return sysRoleMapper.updateById(sysRole)>0;
    }


}
